package com.bw.ppjokeplay.mvvm.view.find

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.viewpager.widget.ViewPager
import com.bw.ppjokeplay.BR
import com.bw.ppjokeplay.R
import com.bw.ppjokeplay.adapter.MyvpAdapter
import com.bw.ppjokeplay.commen.mvvm.view.BaseFragment

import com.bw.ppjokeplay.mvvm.view.find.fragmentfind.ConcernFragment
import com.bw.ppjokeplay.mvvm.view.find.fragmentfind.RecommendFragment
import com.bw.ppjokeplay.mvvm.viewmodel.find.FindViewModel
import com.flyco.tablayout.SlidingTabLayout

/**
 * @author Lishaohe
 * @description:
 * @date :2021/11/10 0010 下午 2:56
 *
 */
class FindFragment : Fragment() {
    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {

        val inflate = inflater.inflate(R.layout.fragment_find, container, false)
        val tab = inflate.findViewById<SlidingTabLayout>(R.id.tabfind)
        val VP = inflate.findViewById<ViewPager>(R.id.VPfind)
        val string = ArrayList<String>()
        val fragment = ArrayList<Fragment>()
        string.add("关注")
        string.add("推荐")
        fragment.add(ConcernFragment())
        fragment.add(RecommendFragment())
        val myvpAdapter = MyvpAdapter(childFragmentManager)
        myvpAdapter!!.fragment=fragment
        myvpAdapter!!.string=string
        VP.adapter = myvpAdapter
        tab.setViewPager(VP)
        return inflate

    }

}